package org.example.lotterysystem.dao.dataobject;

import lombok.EqualsAndHashCode;

import java.util.Objects;
@EqualsAndHashCode(callSuper = true)
public class UserDO extends BaseDO{

    /**
     * 用户名
     */
    private String userName;
    /**
     * 邮箱
     */
    private String email;
    /**
     * 手机号
     */
    private Encrypt phoneNumber;
    /**
     *密码
     */
    private String password;
    /**
     * 身份信息
     */
    private String identity;

    public String getEmail() {
        return email;
    }

    @Override
    public String toString() {
        return "UserDO{" +
                "userName='" + userName + '\'' +
                ", email='" + email + '\'' +
                ", phoneNumber=" + phoneNumber +
                ", password='" + password + '\'' +
                ", identity='" + identity + '\'' +
                '}';
    }

    public String getIdentity() {
        return identity;
    }

    public void setIdentity(String identity) {
        this.identity = identity;
    }

    @Override
    public boolean equals(Object object) {
        super.equals(object);
        if (this == object) return true;
        if (object == null || getClass() != object.getClass()) return false;
        UserDO userDO = (UserDO) object;
        return Objects.equals(userName, userDO.userName) && Objects.equals(email, userDO.email) && Objects.equals(phoneNumber, userDO.phoneNumber) && Objects.equals(password, userDO.password) && Objects.equals(identity, userDO.identity);
    }

    @Override
    public int hashCode() {
        super.hashCode();
        return Objects.hash(userName, email, phoneNumber, password, identity);
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }



    public Encrypt getPhoneNumber() {
        return phoneNumber;
    }

    public void setPhoneNumber(Encrypt phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }


}
